ÄúµÄλÖãºÑ°ÃÎÍøÊ×Ò³£¾±à³ÌÀÖÔ°£¾VBScript£¾VBScript


objects constants operators statements functions properties methods






STATEMENT:  Option Explicit

Option Explicit

The Option Explicit statement forces the explicit declaration of all variables using the Dim, Private, Public, or ReDim statements.

In a long program, this statement prevents the accidental reuse of the name of a previously declared variable. Also, if you mistype a declared variable's name or try to use an undeclared variable, an error message is generated.

Note that the Option Explicit statement must be placed at the top of the code before any other VBScript commands or any HTML code.

Code:
<% Option Explicit %>
< HTML >
< HEAD >
< TITLE > EXAMPLE < /TITLE >
< /HEAD >
< BODY >
<% Dim myvariable = 123.456  yourvar = 0 %>
< /BODY >
< /HTML >